/*
 * @Author: EltonLi lijiaming@uavi-tech.com
 * @Date: 2024-03-28 18:23:51
 * @LastEditors: EltonLi lijiaming@uavi-tech.com
 * @LastEditTime: 2024-03-29 11:37:35
 * @FilePath: \PREMIUM_RTThread_V1.0\drivers\common\include\drv_hwtimer.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-03-16     Leo          first version
 */

#ifndef __TMR_CONFIG_H__
#define __TMR_CONFIG_H__

#include <rtthread.h>
#include <drivers/hwtimer.h>

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef TMR_DEV_INFO_CONFIG
#define TMR_DEV_INFO_CONFIG            \
    {                                  \
        .maxfreq = 1000000,            \
        .minfreq = 4000,               \
        .maxcnt = 0xFFFF,              \
        .cntmode = HWTIMER_CNTMODE_UP, \
    }
#endif /* TIM_DEV_INFO_CONFIG */

#ifdef BSP_USING_HWTMR2
#ifndef TMR2_CONFIG
#define TMR2_CONFIG                   \
    {                                 \
        .tmr_x = TMR2,                \
        .tmr_irqn = TMR2_GLOBAL_IRQn, \
        .name = "timer2",             \
    }
#endif /* TMR2_CONFIG */
#endif /* BSP_USING_HWTMR2 */

#ifdef BSP_USING_HWTMR3
#ifndef TMR3_CONFIG
#define TMR3_CONFIG                   \
    {                                 \
        .tmr_x = TMR3,                \
        .tmr_irqn = TMR3_GLOBAL_IRQn, \
        .name = "timer3",             \
    }
#endif /* TMR3_CONFIG */
#endif /* BSP_USING_HWTMR3 */

#ifdef BSP_USING_HWTMR4
#ifndef TMR4_CONFIG
#define TMR4_CONFIG                   \
    {                                 \
        .tmr_x = TMR4,                \
        .tmr_irqn = TMR4_GLOBAL_IRQn, \
        .name = "timer4",             \
    }
#endif /* TMR4_CONFIG */
#endif /* BSP_USING_HWTMR4 */

#ifdef BSP_USING_HWTMR5
#ifndef TMR5_CONFIG
#define TMR5_CONFIG                   \
    {                                 \
        .tmr_x = TMR5,                \
        .tmr_irqn = TMR5_GLOBAL_IRQn, \
        .name = "timer5",             \
    }
#endif /* TMR5_CONFIG */
#endif /* BSP_USING_HWTMR5 */

#ifdef BSP_USING_HWTMR11
#ifndef TMR11_CONFIG
#define TMR11_CONFIG                                \
    {                                               \
        .tmr_x = TMR11,                             \
        .tmr_irqn = TMR1_TRG_HALL_TMR11_IRQn, \
        .name = "timer11",                          \
    }
#endif /* TMR5_CONFIG */
#endif /* BSP_USING_HWTMR11 */

#ifdef __cplusplus
}
#endif

#endif /* __TMR_CONFIG_H__ */
